if (islogin()) {
    $.post({
        url:'../../requests/teacher/select_me.php',
        success:function (data) {
            $('.num').text(data.num);
            $('.name').text(data.name);
        }
    });

    $('#btn_change_psw').click(function () {
        $$.modal({
            title:'请输入新密码',
            afterText:"<input type='password' id='psw'>",
            buttons:[
                {
                    text:'取消'
                },
                {
                    text:'确定',
                    onClick:function(){
                        var psw=$.md5($('#psw').val());
                        $.post({
                            url:'../../requests/teacher/change_psw.php',
                            data:{'psw':psw},
                            success:function (data) {
                                if (data == '1') {
                                    $$.alert('修改成功！',function () {
                                        window.location.href='../../index.html';
                                    })
                                }
                                else {
                                    $$.alert('修改失败！')
                                }
                            }
                        });
                    }
                }
            ]
        });
    });
}
else window.location.href='../../index.html';